The Pseudosquares Prime Sieve
نویسنده
چکیده
We present the pseudosquares prime sieve, which finds all primes up to n. Define p to be the smallest prime such that the pseudosquare Lp > n/(π(p)(logn)); here π(x) is the prime counting function. Our algorithm requires only O(π(p)n) arithmetic operations and O(π(p) log n) space. It uses the pseudosquares primality test of Lukes, Patterson, and Williams. Under the assumption of the Extended Riemann Hypothesis, we have p ≤ 2(log n), but it is conjectured that p ∼ 1 log 2 log n log log n. Thus, the conjectured complexity of our prime sieve is O(n log n) arithmetic operations in O((log n)) space. The primes generated by our algorithm are proven prime unconditionally. The best current unconditional bound known is p ≤ n √ e− , implying a running time of roughly n using roughly n space. Existing prime sieves are generally faster but take much more space, greatly limiting their range (O(n/ log log n) operations with n space, or O(n) operations with n conjectured space). Our algorithm found all 13284 primes in the interval [10, 10 + 10] in about 4 minutes on a 1.3GHz Pentium IV. We also present an algorithm to find all pseudosquares Lp up to n in sublinear time using very little space. Our innovation here is a new, space-efficient implementation of the wheel datastructure.
منابع مشابه
Doubly-Focused Enumeration of Pseudosquares and Pseudocubes (DRAFT)
This paper offers numerical evidence for a conjecture that primality proving may be done in (logN) operations by examining the growth rate of quantities known as pseudosquares and pseudocubes. In the process, a novel method of solving simultaneous congruences— doubly-focused enumeration— is examined. This technique, first described by D. J. Bernstein, allowed us to obtain record-setting sieve c...
متن کاملSome results on pseudosquares
If p is an odd prime, the pseudosquare Lp is defined to be the least positive nonsquare integer such that Lp ≡ 1 (mod 8) and the Legendre symbol (Lp/q) = 1 for all odd primes q ≤ p. In this paper we first discuss the connection between pseudosquares and primality testing. We then describe a new numerical sieving device which was used to extend the table of known pseudosquares up to L271. We als...
متن کاملTwo Compact Incremental Prime Sieves
A prime sieve is an algorithm that finds the primes up to a bound n. We say that a prime sieve is incremental, if it can quickly determine if n+1 is prime after having found all primes up to n. We say a sieve is compact if it uses roughly √ n space or less. In this paper we present two new results: • We describe the rolling sieve, a practical, incremental prime sieve that takes O(n log logn) ti...
متن کاملSieve Methods
Preface Sieve methods have had a long and fruitful history. The sieve of Eratosthenes (around 3rd century B.C.) was a device to generate prime numbers. Later Legendre used it in his studies of the prime number counting function π(x). Sieve methods bloomed and became a topic of intense investigation after the pioneering work of Viggo Brun (see [Bru16],[Bru19], [Bru22]). Using his formulation of ...
متن کاملOn pseudosquares and pseudopowers
Introduced by Kraitchik and Lehmer, an x-pseudosquare is a positive integer n ≡ 1 (mod 8) that is a quadratic residue for each odd prime p ≤ x, yet is not a square. We give a subexponential upper bound for the least x-pseudosquare that improves on a bound that is exponential in x due to Schinzel. We also obtain an equi-distribution result for pseudosquares. An x-pseudopower to base g is a posit...
متن کامل